package day11;

import java.util.Scanner;
public class Test02 {
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int[] grade = new int[5];
            int best = 0;
            System.out.println("输入成绩：");
            for (int i = 0; i < grade.length; i++) {
                System.out.print("科目" + (i + 1) + "的成绩：");
                grade[i] = scanner.nextInt(); // 读取输入的成绩
                if (grade[i] > best) {
                    best = grade[i];
                }
            }
            System.out.println("输出成绩和等级：");
            for (int i = 0; i < grade.length; i++) {
                System.out.print("科目" + (i + 1) + "的成绩：" + grade[i]);
                if (grade[i] >= best - 10) {
                    System.out.println(" "+'A');
                } else if (grade[i] >= best - 20) {
                    System.out.println(" "+'B');
                } else if (grade[i] >= best - 30) {
                    System.out.println(" "+'C');
                } else if (grade[i] >= best - 40) {
                    System.out.println(" "+'D');
                } else {
                    System.out.println(" "+'E');
                }
            }
            System.out.println("最高成绩：" + best);
        }
    }
}
